package qj.tool.jna;

import java.util.HashMap;
import java.util.Map;

import com.sun.jna.Native;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIFunctionMapper;
import com.sun.jna.win32.W32APITypeMapper;

public class TreuBacKien {
	public static void main(String[] args) {
		User32 user32 = User32.INSTANCE;
		user32.LockWorkStation();
	}

    @SuppressWarnings({ "unchecked", "serial" })
	static interface User32 extends StdCallLibrary {

	    /** Standard options to use the unicode version of a w32 API. */
		Map UNICODE_OPTIONS = new HashMap() {
	        {
	            put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
	            put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
	        }
	    };
	    /** Standard options to use the ASCII/MBCS version of a w32 API. */
	    Map ASCII_OPTIONS = new HashMap() {
	        {
	            put(OPTION_TYPE_MAPPER, W32APITypeMapper.ASCII);
	            put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.ASCII);
	        }
	    };
	    Map DEFAULT_OPTIONS = Boolean.getBoolean("w32.ascii") ? ASCII_OPTIONS : UNICODE_OPTIONS;
	    
	    User32 INSTANCE = (User32)
	        Native.loadLibrary("user32", User32.class, DEFAULT_OPTIONS);
	    
	    void LockWorkStation();
		
	}
}
